<?php $this->JQuery()->enable();?>

<script type="text/javascript">
$(function(){
	 
    // add multiple select / deselect functionality
    $("#selectall").click(function () {
          $('.case').attr('checked', this.checked);
    });
 
    // if all checkbox are selected, check the selectall checkbox
    // and viceversa
    $(".case").click(function(){
 
        if($(".case").length == $(".case:checked").length) {
            $("#selectall").attr("checked", "checked");
        } else {
            $("#selectall").removeAttr("checked");
        }
 
    });
});
</script>
<!--  start product-table ..................................................................................... -->
				<form id="mainform" action="" method="post">
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-check"><input type="checkbox" id="selectall"/></th>
					<th class="table-header-repeat line-left"><a href="">ID</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Họ Tên</a></th>
					<th class="table-header-repeat line-left"><a href="">Năm sinh</a></th>
					<th class="table-header-repeat line-left"><a href="">Điện thoại</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Email</a></th>
					<th class="table-header-repeat line-left"><a href="">Ngày đăng ký</a></th>

					<th class="table-header-options line-left"><a href="">Tùy chọn</a></th>
				</tr>
				
				
<?php
	foreach($this->hocvien as $hocvien)
	{
		$id = $hocvien->getId();
		$tenhocvien = $hocvien->getTenhocvien();
		$namsinh = $hocvien->getNamsinh();
		$dienthoai = $hocvien->getDienthoai();
		$email = $hocvien->getEmail();
		$ngaydangky= $hocvien->getDate();
		$linkEdit = $this->baseUrl('/admin/hocvien/capnhat/id/'. $id);
		$linkDelete = $this->baseUrl('/admin/hocvien/xoa/id/'. $id);
?>
	<tr>
					<td><?php echo $this->formCheckbox('case'.$id,'1',array('class'=>'case'));?></td>
					<td><?php echo $id?></td>
					<td><?php echo $tenhocvien?></td>
					<td><?php echo $namsinh?></td>
					<td><?php echo $dienthoai?></td>
					<td><?php echo $email?></td>
					<td><?php echo $ngaydangky?></td>
					<td class="options-width">
					<a href="<?php echo $linkEdit?>" title="Edit" class="icon-1 info-tooltip"></a>
					<a href="<?php echo $linkDelete?>" title="Edit" class="icon-2 info-tooltip"></a>
					</td>
				</tr>
<?php
			
	} 
?>
			</table>
			<?php echo $this->formSubmit('submit','Xóa chọn')?>
				<!--  end product-table................................... -->
				</form>
